var extension_key="llhmbobhecbhidmecocncgknmjjlnlin";
 
function loadSettings(){ 
       getRemainingTime(); 
       getIframeSetting(); 
} 
 
 
function getIframeSetting(){ 
 
     var is_iframe_load = localStorage.loadiframe; 
     if (!is_iframe_load){ 
       is_iframe_load = true; 
       localStorage.loadiframe = true; 
     } 
 
     var e = document.getElementById("renrenIframe"); 
      
     if (is_iframe_load == "true"){ 
       //add the block 
       e.innerHTML = '<iframe scrolling="no" frameborder="0" class="streamIframe" src="http://www.connect.renren.com/widget/livewidget.do?api_key=f96c296a155a4669ad94800f3f7824eb&xid=test_xid&url=http%3A%2F%2Fwidget.renren.com%2FconnectWidget%2FwidgetConsole%3Fwizard%3Dlivestream&desp=%E5%A4%A7%E5%AE%B6%E5%BF%AB%E6%9D%A5%E8%AE%A8%E8%AE%BA%E5%90%A7" name="streamIFrame_0"  style="width: 380px;height: 400px;"></iframe>'; 
     } 
} 
 
function getRemainingTime(){ 
	if (!localStorage.browsingTime){ 
		localStorage.browsingTime = 20; 
	} 
	 
	if (!localStorage.remainingTime){ 
		localStorage.remainingTime = localStorage.browsingTime * 60000; 
	} 
	 
	var time = localStorage.browsingTime - localStorage.remainingTime/60000;  
	//window.alert(time); 
 
	document.getElementById('remaintime').innerHTML  = time.toFixed(0); 
}	


function redirect_to_internal_page(pageName){
	 var retVal = new Object();
  	retVal.url= pageName;
  	retVal.selected =true;
	chrome.tabs.create(retVal,function (tab){});
} 
